package com.yuxi.Dao.Impl;

import java.io.Serializable;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.yuxi.Dao.ModifyInformationRecordDao;
import com.yuxi.Entity.ModifyInformationRecord;

@Repository
public class ModifyInformationRecordDaoImpl extends BaseDaoImpl<Serializable, Serializable> implements ModifyInformationRecordDao {
	private Logger logger=LoggerFactory.getLogger(ModifyInformationRecordDaoImpl.class);
	public ModifyInformationRecordDaoImpl(){
		super(ModifyInformationRecord.class);
	}
	@Override
	public ModifyInformationRecord getIRecord(Integer mIRecordId) {
		// TODO Auto-generated method stub
		return (ModifyInformationRecord) super.get(mIRecordId);
	}

	@Override
	public ModifyInformationRecord addIRecord(ModifyInformationRecord mIRecord) {
		// TODO Auto-generated method stub
		return (ModifyInformationRecord) super.addAndReturn(mIRecord);
	}

	@Override
	public void deleteIRecord(ModifyInformationRecord mIRecord) {
		// TODO Auto-generated method stub
		super.delete(mIRecord);
	}

	@Override
	public void modifly(ModifyInformationRecord mIRecord) {
		// TODO Auto-generated method stub
		super.update(mIRecord);
	}
	@Override
	public ModifyInformationRecord getModifyRecordByInfoIdAndRecoredId(Integer recordId, Integer infoId) {
		return (ModifyInformationRecord) super.find("from ModifyInformationRecord where recordId=? and informationId=? order by informationId", recordId,infoId).get(0);
	}
	@Override
	public List<ModifyInformationRecord> getAllModifyRecordByInfoId(Integer infoId) {
		return  super.find("from ModifyInformationRecord where  informationId=? order by informationId,recordId",infoId);

	}
}
